home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-05 | 3.9 KB | 121 lines | [TEXT/KAHL] |
- ///--------------------------------------------------------------------------------------
- // Frame.h
- //
- // Created: Wednesday, October 28, 1992 at 8:39:10 PM
- // By: Tony Myles
- //
- // Copyright: © 1991-93 Tony Myles, All rights reserved worldwide
- //
- // Description: constants, structures, and prototypes for frames
- ///--------------------------------------------------------------------------------------
-
-
- #ifndef __FRAME__
- #define __FRAME__
-
- #ifndef __QDOFFSCREEN__
- #include <QDOffscreen.h>
- #endif
-
- #ifndef SW_PASCAL
- #define SW_PASCAL
- #endif
-
-
- ///--------------------------------------------------------------------------------------
- // frame type definitions
- ///--------------------------------------------------------------------------------------
-
- typedef struct FrameRec FrameRec;
- typedef FrameRec *FramePtr, **FrameHdl;
-
-
- ///--------------------------------------------------------------------------------------
- // frame data structure
- ///--------------------------------------------------------------------------------------
-
- struct FrameRec
- {
- union
- {
- CGrafPtr colorGrafP; // color port for the frame image
- GrafPtr monoGrafP; // mono port for the frame image
- } framePort;
-
- union
- {
- PixMapPtr pixMapP; // pointer color pix map (valid only while locked)
- BitMapPtr bitMapP; // pointer mono bit map (valid only while locked)
- } framePix;
-
- unsigned long *frameBaseAddr; // base address of pixel data (valid only while locked)
- unsigned long frameRowBytes; // number of bytes in a row of the frame
- unsigned long frameRowLongs; // number of long words in a row of the frame
- short leftAlignFactor; // used to align the rect.left to the nearest long word
- short rightAlignFactor; // used to align the rect.right to the nearest long word
- Boolean isFrameLocked; // has the frame been locked?
- Boolean isColor; // is this a color frame?
-
- Rect frameRect; // source image rectangle
- Point offsetPoint; // image offset factor relative to destination rectangle
- RgnHandle maskRgn; // image masking region
-
- union
- {
- CGrafPtr colorGrafP; // color port for the mask image
- GrafPtr monoGrafP; // mono port for the mask image
- } maskPort;
-
- union
- {
- PixMapPtr pixMapP; // pointer to color pix map (valid only while locked)
- BitMapPtr bitMapP; // pointer to mono bit map (valid only while locked)
- } maskPix;
-
- unsigned long *maskBaseAddr; // base address of mask pixel data (valid only while locked)
- Boolean isMaskLocked; // has the mask been locked?
- };
-
-
- ///--------------------------------------------------------------------------------------
- // frame flags constants
- ///--------------------------------------------------------------------------------------
-
- typedef enum
- {
- kNoMask = 0,
- kPixelMask = 1,
- kRegionMask = 2,
- kFatMask = (kPixelMask + kRegionMask)
- } MaskType;
-
-
- ///--------------------------------------------------------------------------------------
- // frame function prototypes
- ///--------------------------------------------------------------------------------------
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- SW_PASCAL OSErr SWCreateFrame(FramePtr* newFrameP, CGrafPtr srcGrafP, Rect* frameRect);
- SW_PASCAL OSErr SWCreateFrameFromCIconResource(FramePtr* newFrameP, short iconResID, MaskType maskType);
- SW_PASCAL OSErr SWCreateFrameFromPictResource(FramePtr* newFrameP, short pictResID, short maskResID, MaskType maskType);
- SW_PASCAL void SWDisposeFrame(FramePtr oldFrameP);
-
- SW_PASCAL void SWSetFrameGWorld(FramePtr srcFrameP, GWorldPtr frameGWorldP);
- SW_PASCAL void SWSetFrameMaskRgn(FramePtr srcFrameP, RgnHandle maskRgn);
- SW_PASCAL void SWSetFrameMaskGWorld(FramePtr srcFrameP, GWorldPtr maskGWorldP);
- SW_PASCAL RgnHandle SWGetFrameMaskRgn(FramePtr srcFrameP);
- SW_PASCAL void SWSetFrameRect(FramePtr srcFrameP, Rect* newFrameRect);
-
- SW_PASCAL void SWLockFrame(FramePtr srcFrameP);
- SW_PASCAL void SWUnlockFrame(FramePtr srcFrameP);
-
- SW_PASCAL void SWCopyFrame(FramePtr srcFrameP, FramePtr dstFrameP);
-
- #ifdef __cplusplus
- };
- #endif
-
- #endif /* __FRAME__ */